GBML manual / Constants

BGLOOK_FLOOR

A scrolling floor: the lower a row is on the screen, the faster it slides, so a flat picture looks like a floor going away from you.

Syntax

BGLOOK_FLOOR: constant

<!-- GENERATED by tools/gbabel_looks.py from its LOOKS registry. Never edit this page: change the registry and re-run it. -->

Description

Names the scrolling floor, for background_look. Every row of the screen slides sideways at its own speed: the bottom row is the quickest, and each row above it is a little slower. Your eye reads that as distance, so a flat picture of a floor, a road or a sea looks like it runs away from you.

strength is how still the top of the screen stays: 1 slides the top row at half the speed of the bottom row, 2 at a quarter and 3 not at all, so the top of a picture stands still like a horizon.

A real capture, four pictures of the same green field with white lines on it - straight, then with BGLOOK_FLOOR at strength 1, strength 2 and strength 3 (the lines lean over because the lower a row is, the further it has slid; at strength 3 the top of the screen has not moved at all)A real capture, four pictures of the same green field with white lines on it - straight, then with BGLOOK_FLOOR at strength 1, strength 2 and strength 3 (the lines lean over because the lower a row is, the further it has slid; at strength 3 the top of the screen has not moved at all)
A real capture, four pictures of the same green field with white lines on it - straight, then with BGLOOK_FLOOR at strength 1, strength 2 and strength 3 (the lines lean over because the lower a row is, the further it has slid; at strength 3 the top of the screen has not moved at all)

The same room four times: straight, then strength 1, 2 and 3. A floor shows only while it slides, so each of the three is ten frames after the look was asked for, at a speed of 2. Real pictures from a Game Boy Advance ROM.

speed is how many pixels the bottom row slides every frame. A positive number slides the picture to the right and a negative one to the left. 0 holds it still. The rows above slide at a share of that. It never stops until you turn it off, however long the game runs.

A real capture, 16 frames played in a loop - the green field slides sideways, the lines near the bottom of the screen moving fast and the ones near the top slowly, so they lean over more and more as the field slidesA real capture, 16 frames played in a loop - the green field slides sideways, the lines near the bottom of the screen moving fast and the ones near the top slowly, so they lean over more and more as the field slides
A real capture, 16 frames played in a loop - the green field slides sideways, the lines near the bottom of the screen moving fast and the ones near the top slowly, so they lean over more and more as the field slides

The floor sliding, sped up: sixteen real pictures four frames apart, played 70 milliseconds each, at strength 3 and a speed of 1. This picture is an animated PNG; a viewer that cannot animate shows its first frame. A floor never comes round to where it began, so the loop jumps.

Example

backdrop = background_create(0, 0, ts_doc_dungeon);
background_look(backdrop, BGLOOK_FLOOR, 2, 1);

A floor that slides past, the bottom of the picture quickest. Turn it off with background_look(my_background, BGLOOK_NONE, 0, 0) before you destroy the background.

See also: background_lookBGLOOK_NONEBGLOOK_ROAD